<template>
	<view class="">
		<view>
			<view class="u-page__item">
				<u-collapse accordion>
					<u-cell v-for="(paper, index) in allList" :key="index" :isLink="true" size="large"
						:value="paper.status == 2 ? '查看试卷' : '批改'"
						:title="paper.paperName">
						<!-- 自定义 label 内容 -->
						<view slot="label">
							<view>{{ paper.subjectName }}</view>
							<view style="margin-top: 5px;">对错：{{ paper.userScore }}/{{ paper.paperScore }}</view>
							<view style="margin-top: 5px;">时间：{{ paper.createTime }}</view>
						</view>
					</u-cell>
				</u-collapse>
			</view>
		</view>
		<u-divider text="暂无更多内容"></u-divider>
	</view>
</template>

<script>
	import http from '../../http';
	export default {
		data() {
			return {
				allList: [],
				list1: [{
						name: '固定试卷'
					},
					{
						name: '',
						scrollable: false,
						disabled: true,
						customStyle: {
							width: '100rpx'
						}
					}, // 增加空白项宽度
					{
						name: '',
						scrollable: false,
						disabled: true,
						customStyle: {
							width: '100rpx'
						}
					}, // 增加空白项宽度
					{
						name: '',
						scrollable: false,
						disabled: true,
						customStyle: {
							width: '100rpx'
						}
					}, // 增加空白项宽度
					{
						name: '',
						scrollable: false,
						disabled: true,
						customStyle: {
							width: '100rpx'
						}
					}, // 增加空白项宽度
					{
						name: '',
						scrollable: false,
						disabled: true,
						customStyle: {
							width: '100rpx'
						}
					}, // 增加空白项宽度
					{
						name: '时段试卷'
					}
				]
			}
		},
		methods: {
			click(item) {
				console.log('item', item);
			},
			getPaperList() {
				http({
					url: "/api/student/exampaper/answer/pageList",
					method: "post",
					data: {
						"pageIndex": "1", //页码
						"pageSize": "10" //每页条数
					}
				}).then(res => {
					console.log(res);
					if (res.code === 1) {
						this.allList = res.response.list
						console.log(this.allList);
					}
				});
			}
		},
		onLoad() {
			this.getPaperList()
		}
	}
</script>

<style scoped>
	/* 增加自定义样式 */
	::v-deep .u-tabs__wrapper__item {
		padding: 0 30rpx;
		/* 增加选项卡内边距 */
	}
</style>